<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    let money = 1000
    for( ;;){
      let admin = +prompt(`请输入你要做的操作
        1.取钱
        2.存钱
        3.查看余额
        4.退出
      `)
      if(admin === 1){    //输入满足1时取钱
        let qu = +prompt('请输入你要去的金额')
        if(money >= qu){  //判断余额和要取得金额大小对比
          money-=qu
        } else {
          alert('你的金额不足')
        }
      } 
      else if (admin === 2){//输入满足2时存钱
        let cun = +prompt('请输入你要存的金额')
        money+=cun          //money总余额加存
      } 
      else if (admin === 3){//输入满足3时查看总额money
        alert(`你的余额为${money}`)
      }
      else if (admin===4){  //输入满足4时退出循环
        alert('欢迎下次使用')
        break
      }else{
        alert('请按规定输入')
      }
    }
  </script>
</body>
</html>